package com.mysteel.member.web;

import com.mysteel.common.utils.R;
import com.mysteel.member.feign.OrderFeignService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.HashMap;
import java.util.Map;

/**
 * ProjectName: mail
 * ClassName: MemberWebController
 * Description:
 * date: 2021/04/02/002 11:40
 *
 * @author xiaochao
 */
@Controller
public class MemberWebController {

    @Autowired
    private OrderFeignService orderFeignService;

    @GetMapping("/memberOrder.html")
    public String memberOrderPage(@RequestParam(value = "pageNum",defaultValue = "1") String pageNum, Model model){
        Map<String,Object> pageParam = new HashMap<>(1);
        pageParam.put("page",pageNum);
        R feignResult = orderFeignService.listWithItem(pageParam);
        model.addAttribute("orders",feignResult);
        return "orderList";
    }
}
